package ljl.alg.jianzhioffer.round3.easy;

import commons.ListNode;

public class _6_reverse_print {
    
    int total, i;
    int[] res;
    
    public int[] reversePrint(ListNode head) {
        if (head == null) {
            res = new int[total];
        } else {
            total++;
            reversePrint(head.next);
            res[i++] = head.val;
        }
        return res;
    }
    
}
